<template>
<div class="gallary" @click="gallaryclick">
  <div class="gallary-wrapper">
    <swiper :options="swiperOption">
      <swiper-slide v-for="(item,index) of img" :key="index">
        <img class="gallary-swiper-img" :src="item" />
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</div>
</template>

<script>
export default {
  name: 'CommonGallary',
  methods: {
    gallaryclick () {
      this.$emit('close')
    }
  },
  props: {
    img: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observeParents: true,
        observer: true
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
.gallary >>> .swiper-container
  overflow: inherit
.gallary
  display: flex
  flex-direction: column
  justify-content: center
  z-index: 99
  position: fixed
  color: #fff
  background: #000
  left: 0
  right: 0
  top: 0
  bottom: 0
  .gallary-wrapper
    .gallary-swiper-img
      width: 100%
    .swiper-pagination
      bottom: -2.1rem
</style>
